package edu.面向对象基础.构造方法.案例;

/*JavaBean类：封装数据*/
public class Student {
    private String name;
    private int age;

    //右键：Generate->Constructor->全选——》ok   操作两次
    //无参数构造
    public Student(){}
    //有参构造
    public Student(String name,int age){
        this.age=age;
        this.name=name;
    }

//右键：Generate-->Getter and Setter-->全选--》ok  一次就好
    //set /get
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    //show
    public void show(){
        System.out.println(name+"..."+age);
    }
}
